package org.southyin.springboot01.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.southyin.springboot01.mapper.HelloMapper;
import org.southyin.springboot01.model.CmsArticle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HelloService {
    @Autowired
    HelloMapper mapper;
    public PageInfo hello(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<CmsArticle> list = mapper.listArticle();
        PageInfo pageInfo = new PageInfo(list);
        return pageInfo;
    }
}
